package uk.ac.lkl.lpp.model;



import uk.ac.lkl.lpp.model.PedagogyPlanModel;

import uk.ac.lkl.lpp.model.ldo.TeachingMethod;


public class TeachingMethodPreparationTimeFieldGroup extends
        TeachingMethodFieldGroup {

    public TeachingMethodPreparationTimeFieldGroup(PedagogyPlanModel model) {
        super(model);
    }


    public int size() {
        return 5;
    }


    public Class getClass(int fieldIndex) {
        switch (fieldIndex) {
        case 0:
            return String.class;
        case 1:
            return Float.class;
        case 2:
            return String.class;
        case 3:
            return Float.class;
        case 4:
            return String.class;
        default:
            throw new IllegalArgumentException("Invalid field index: "
                    + fieldIndex);
        }
    }


    public boolean isEditable(TeachingMethod teachingMethod, int fieldIndex) {
        switch (fieldIndex) {
        case 0:
            return false;
        case 1:
            return true;
        case 2:
            return false;
        case 3:
            return true;
        case 4:
            return false;
        default:
            throw new IllegalArgumentException("Invalid field index: "
                    + fieldIndex);
        }
    }


    // dummy values for numbers for now
    protected Object getField(int listIndex,
                              TeachingMethod teachingMethod,
                              int fieldIndex) {
        switch (fieldIndex) {
        case 0:
            return "It takes";
        case 1:
            return 0.5f;
        case 2:
            return "to prepare a";
        case 3:
            return 2f;
        case 4:
            return "teaching method";
        default:
            throw new IllegalArgumentException("Invalid field index: "
                    + fieldIndex);
        }
    }


    public void setField(TeachingMethod teachingMethod,
                         int fieldIndex,
                         Object object) {
        // uneditable for now
        return;
    }


    public String getName() {
        return "Preparation time";
    }


    @Override
    public String getFieldName(int fieldIndex) {
        switch (fieldIndex) {
        case 0:
            return null;
        case 1:
            return "Preparation Time";
        case 2:
            return null;
        case 3:
            return "Learner Hours";
        case 4:
            return null;
        default:
            throw new IllegalArgumentException("Invalid field index: "
                    + fieldIndex);
        }
    }


    @Override
    public boolean isPermanent() {
        return false;
    }


    @Override
    public Object calculateTotal(int fieldIndex) {
        return null;
    }
}
